
 <!DOCTYPE HTML>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
  <!-- Global Site Tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-84488915-1"></script>
  <script>
  window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

        gtag('config', 'UA-84488915-1');
  </script>
  
    <title>linyu blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="linyu">
    

    
    <meta property="og:type" content="website">
<meta property="og:title" content="linyu blog">
<meta property="og:url" content="http://bigsuperangel.github.io/page/3/index.html">
<meta property="og:site_name" content="linyu blog">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="linyu blog">

    
    <link rel="alternative" href="/atom.xml" title="linyu blog" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/jacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
    
    <link rel="stylesheet" href="/css/style.css">
</head>

  <body>
    <header>
      
<div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="linyu blog" title="linyu blog"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="linyu blog">linyu blog</a></h1>
				<h2 class="blog-motto">Where there is a will,there is a way</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="菜單">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">Home</a></li>
					
						<li><a href="/archives">Archives</a></li>
					
						<li><a href="/tags/linux">linux</a></li>
					
						<li><a href="/tags/java">Java</a></li>
					
					<li>
 					
					<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
						<label>Search</label>
						<input type="search" id="search" name="q" autocomplete="off" maxlength="20" placeholder="搜索" />
						<input type="hidden" name="q" value="site:bigsuperangel.github.io">
					</form>
					
					</li>
				</ul>
			</nav>			
</div>
    </header>
    <div id="container">
      <div id="main">

   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/07/27/maven-web/" title="maven下实时编译web工程" itemprop="url">maven下实时编译web工程</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-07-27T03:11:38.000Z" itemprop="datePublished"> 發表於 2016-07-27</time>
    
  </p>
</header>
    <div class="article-content">
        
        <h3 id="在pom文件build节点下加入"><a href="#在pom文件build节点下加入" class="headerlink" title="在pom文件build节点下加入"></a>在pom文件build节点下加入</h3><pre><code>&lt;outputDirectory&gt;${project.basedir}/src/main/webapp/WEB-INF/classes/&lt;/outputDirectory&gt;
</code></pre><h3 id="web配置"><a href="#web配置" class="headerlink" title="web配置"></a>web配置</h3><ol>
<li>tomcat6</li>
</ol>
<figure class="highlight dust"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="xml"><span class="comment">&lt;!-- tomcat6插件 --&gt;</span></span></div><div class="line"><span class="xml"><span class="tag">&lt;<span class="name">plugin</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.apache.tomcat.maven<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>tomcat6-maven-plugin<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">version</span>&gt;</span>$</span><span class="template-variable">&#123;tomcat.version&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">version</span>&gt;</span> </span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">configuration</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">port</span>&gt;</span>$</span><span class="template-variable">&#123;webserver.port&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">port</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">path</span>&gt;</span>/$</span><span class="template-variable">&#123;project.artifactId&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">path</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">uriEncoding</span>&gt;</span>$</span><span class="template-variable">&#123;project.build.sourceEncoding&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">uriEncoding</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;/<span class="name">configuration</span>&gt;</span></span></div><div class="line"><span class="xml"><span class="tag">&lt;/<span class="name">plugin</span>&gt;</span></span></div></pre></td></tr></table></figure>
<ol>
<li>tomcat7</li>
</ol>
<figure class="highlight dust"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="xml"><span class="comment">&lt;!-- tomcat7插件 --&gt;</span></span></div><div class="line"><span class="xml"><span class="tag">&lt;<span class="name">plugin</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.apache.tomcat.maven<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>tomcat7-maven-plugin<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">version</span>&gt;</span>$</span><span class="template-variable">&#123;tomcat.version&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">version</span>&gt;</span> </span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">configuration</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">port</span>&gt;</span>$</span><span class="template-variable">&#123;webserver.port&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">port</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">path</span>&gt;</span>/$</span><span class="template-variable">&#123;project.artifactId&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">path</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">uriEncoding</span>&gt;</span>$</span><span class="template-variable">&#123;project.build.sourceEncoding&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">uriEncoding</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;/<span class="name">configuration</span>&gt;</span></span></div><div class="line"><span class="xml"><span class="tag">&lt;/<span class="name">plugin</span>&gt;</span></span></div></pre></td></tr></table></figure>
<ol>
<li>jetty</li>
</ol>
<figure class="highlight dust"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div></pre></td><td class="code"><pre><div class="line"><span class="xml"><span class="comment">&lt;!-- jetty插件 --&gt;</span></span></div><div class="line"><span class="xml"><span class="tag">&lt;<span class="name">plugin</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.mortbay.jetty<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>jetty-maven-plugin<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">version</span>&gt;</span>$</span><span class="template-variable">&#123;jetty.version&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">version</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;<span class="name">configuration</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">connectors</span>&gt;</span></span></div><div class="line"><span class="xml">			<span class="tag">&lt;<span class="name">connector</span> <span class="attr">implementation</span>=<span class="string">"org.eclipse.jetty.server.nio.SelectChannelConnector"</span>&gt;</span></span></div><div class="line"><span class="xml">				<span class="tag">&lt;<span class="name">port</span>&gt;</span>$</span><span class="template-variable">&#123;webserver.port&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">port</span>&gt;</span></span></div><div class="line"><span class="xml">			<span class="tag">&lt;/<span class="name">connector</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;/<span class="name">connectors</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">webAppConfig</span>&gt;</span></span></div><div class="line"><span class="xml">			<span class="tag">&lt;<span class="name">contextPath</span>&gt;</span>/$</span><span class="template-variable">&#123;project.artifactId&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">contextPath</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;/<span class="name">webAppConfig</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;<span class="name">systemProperties</span>&gt;</span>  </span></div><div class="line"><span class="xml">			<span class="tag">&lt;<span class="name">systemProperty</span>&gt;</span></span></div><div class="line"><span class="xml">				<span class="tag">&lt;<span class="name">name</span>&gt;</span>org.mortbay.util.URI.charset<span class="tag">&lt;/<span class="name">name</span>&gt;</span></span></div><div class="line"><span class="xml">				<span class="tag">&lt;<span class="name">value</span>&gt;</span>$</span><span class="template-variable">&#123;project.build.sourceEncoding&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">value</span>&gt;</span></span></div><div class="line"><span class="xml">			<span class="tag">&lt;/<span class="name">systemProperty</span>&gt;</span></span></div><div class="line"><span class="xml">		<span class="tag">&lt;/<span class="name">systemProperties</span>&gt;</span></span></div><div class="line"><span class="xml">	<span class="tag">&lt;/<span class="name">configuration</span>&gt;</span></span></div><div class="line"><span class="xml"><span class="tag">&lt;/<span class="name">plugin</span>&gt;</span></span></div></pre></td></tr></table></figure>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/maven/">maven</a><a href="/tags/tomcat/">tomcat</a><a href="/tags/jetty/">jetty</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/07/27/maven-web/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/07/27/maven-web/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/07/27/curl-linux/" title="curl 常用命令" itemprop="url">curl 常用命令</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-07-27T02:37:35.000Z" itemprop="datePublished"> 發表於 2016-07-27</time>
    
  </p>
</header>
    <div class="article-content">
        
        <h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><ul>
<li><a href="http://bbs.et8.net/bbs/showthread.php?t=568472" target="_blank" rel="external">http://bbs.et8.net/bbs/showthread.php?t=568472</a></li>
<li><a href="http://www.ruanyifeng.com/blog/2011/09/curl.html" target="_blank" rel="external">http://www.ruanyifeng.com/blog/2011/09/curl.html</a></li>
</ul>
<h3 id="下载单个文件，默认将输出打印到标准输出中-STDOUT-中"><a href="#下载单个文件，默认将输出打印到标准输出中-STDOUT-中" class="headerlink" title="下载单个文件，默认将输出打印到标准输出中(STDOUT)中"></a>下载单个文件，默认将输出打印到标准输出中(STDOUT)中</h3><pre><code>curl http://www.centos.org
</code></pre><h3 id="通过-o-O选项保存下载的文件到指定的文件中："><a href="#通过-o-O选项保存下载的文件到指定的文件中：" class="headerlink" title="通过-o/-O选项保存下载的文件到指定的文件中："></a>通过-o/-O选项保存下载的文件到指定的文件中：</h3><blockquote>
<ol>
<li>-o：将文件保存为命令行中指定的文件名的文件中</li>
<li>-O：使用URL中默认的文件名保存文件到本地</li>
</ol>
</blockquote>
<pre><code># 将文件下载到本地并命名为mygettext.html
  curl -o mygettext.html http://www.gnu.org/software/gettext/manual/gettext.html

# 将文件保存到本地并命名为gettext.html
  curl -O http://www.gnu.org/software/gettext/manual/gettext.html
</code></pre><p>同样可以使用转向字符”&gt;”对输出进行转向输出</p>
<h3 id="同时获取多个文件"><a href="#同时获取多个文件" class="headerlink" title="同时获取多个文件"></a>同时获取多个文件</h3><pre><code>curl -O URL1 -O URL2
</code></pre><p>若同时从同一站点下载多个文件时，curl会尝试重用链接(connection)。</p>
<p>通过-L选项进行重定向<br>默认情况下CURL不会发送HTTP Location headers(重定向).当一个被请求页面移动到另一个站点时，会发送一个HTTP Loaction header作为请求，然后将请求重定向到新的地址上。<br>例如：访问google.com时，会自动将地址重定向到google.com.hk上。</p>
<pre><code>curl http://www.google.com
&lt;HTML&gt;
&lt;HEAD&gt;
    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html;charset=utf-8&quot;&gt;
    &lt;TITLE&gt;302 Moved&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
    &lt;H1&gt;302 Moved&lt;/H1&gt;
    The document has moved
    &lt;A HREF=&quot;http://www.google.com.hk/url?sa=p&amp;amp;hl=zh-CN&amp;amp;pref=hkredirect&amp;amp;pval=yes&amp;amp;q=http://www.google.com.hk/&amp;amp;ust=1379402837567135amp;usg=AFQjCNF3o7umf3jyJpNDPuF7KTibavE4aA&quot;&gt;here&lt;/A&gt;.
&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre><p>上述输出说明所请求的档案被转移到了<a href="http://www.google.com.hk。" target="_blank" rel="external">http://www.google.com.hk。</a></p>
<p>这是可以通过使用-L选项进行强制重定向</p>
<pre><code>让curl使用地址重定向，此时会查询google.com.hk站点
curl -L http://www.google.com
</code></pre><h3 id="断点续传"><a href="#断点续传" class="headerlink" title="断点续传"></a>断点续传</h3><p>通过使用-C选项可对大文件使用断点续传功能，如：</p>
<pre><code># 当文件在下载完成之前结束该进程
$ curl -O http://www.gnu.org/software/gettext/manual/gettext.html
##############             20.1%

# 通过添加-C选项继续对该文件进行下载，已经下载过的文件不会被重新下载
curl -C - -O http://www.gnu.org/software/gettext/manual/gettext.html
###############            21.1%
</code></pre><h3 id="对CURL使用网络限速"><a href="#对CURL使用网络限速" class="headerlink" title="对CURL使用网络限速"></a>对CURL使用网络限速</h3><p>通过–limit-rate选项对CURL的最大网络使用进行限制</p>
<pre><code>下载速度最大不会超过1000B/second

curl --limit-rate 1000B -O http://www.gnu.org/software/gettext/manual/gettext.html
</code></pre><p>下载指定时间内修改过的文件</p>
<p>当下载一个文件时，可对该文件的最后修改日期进行判断，如果该文件在指定日期内修改过，就进行下载，否则不下载。<br>该功能可通过使用-z选项来实现：</p>
<pre><code>若yy.html文件在2011/12/21之后有过更新才会进行下载
curl -z 21-Dec-11 http://www.example.com/yy.html
</code></pre><h3 id="CURL授权"><a href="#CURL授权" class="headerlink" title="CURL授权"></a>CURL授权</h3><p>在访问需要授权的页面时，可通过-u选项提供用户名和密码进行授权</p>
<pre><code>curl -u username:password URL

# 通常的做法是在命令行只输入用户名，之后会提示输入密码，这样可以保证在查看历史记录时不会将密码泄露
curl -u username URL
</code></pre><h3 id="从FTP服务器下载文件"><a href="#从FTP服务器下载文件" class="headerlink" title="从FTP服务器下载文件"></a>从FTP服务器下载文件</h3><p>CURL同样支持FTP下载，若在url中指定的是某个文件路径而非具体的某个要下载的文件名，CURL则会列出该目录下的所有文件名而并非下载该目录下的所有文件</p>
<pre><code># 列出public_html下的所有文件夹和文件
curl -u ftpuser:ftppass -O ftp://ftp_server/public_html/

# 下载xss.php文件
curl -u ftpuser:ftppass -O ftp://ftp_server/public_html/xss.php
</code></pre><h3 id="上传文件到FTP服务器"><a href="#上传文件到FTP服务器" class="headerlink" title="上传文件到FTP服务器"></a>上传文件到FTP服务器</h3><p>通过 -T 选项可将指定的本地文件上传到FTP服务器上</p>
<pre><code># 将myfile.txt文件上传到服务器
curl -u ftpuser:ftppass -T myfile.txt ftp://ftp.testserver.com

# 同时上传多个文件
curl -u ftpuser:ftppass -T &quot;{file1,file2}&quot; ftp://ftp.testserver.com

# 从标准输入获取内容保存到服务器指定的文件中
curl -u ftpuser:ftppass -T - ftp://ftp.testserver.com/myfile_1.txt
</code></pre><h3 id="获取更多信息"><a href="#获取更多信息" class="headerlink" title="获取更多信息"></a>获取更多信息</h3><p>通过使用 -v 和 -trace获取更多的链接信息</p>
<h3 id="通过字典查询单词"><a href="#通过字典查询单词" class="headerlink" title="通过字典查询单词"></a>通过字典查询单词</h3><pre><code># 查询bash单词的含义
curl dict://dict.org/d:bash

# 列出所有可用词典
curl dict://dict.org/show:db

# 在foldoc词典中查询bash单词的含义
curl dict://dict.org/d:bash:foldoc
</code></pre><h3 id="为CURL设置代理"><a href="#为CURL设置代理" class="headerlink" title="为CURL设置代理"></a>为CURL设置代理</h3><p>x 选项可以为CURL添加代理功能</p>
<pre><code># 指定代理主机和端口
curl -x proxysever.test.com:3128 http://google.co.in
</code></pre><h3 id="保存与使用网站cookie信息"><a href="#保存与使用网站cookie信息" class="headerlink" title="保存与使用网站cookie信息"></a>保存与使用网站cookie信息</h3><pre><code># 将网站的cookies信息保存到sugarcookies文件中
curl -D sugarcookies http://localhost/sugarcrm/index.php

# 使用上次保存的cookie信息
curl -b sugarcookies http://localhost/sugarcrm/index.php
</code></pre><h3 id="传递请求数据"><a href="#传递请求数据" class="headerlink" title="传递请求数据"></a>传递请求数据</h3><p>默认curl使用GET方式请求数据，这种方式下直接通过URL传递数据<br>可以通过 –data/-d 方式指定使用POST方式传递数据</p>
<pre><code># GET
curl -u username https://api.github.com/user?access_token=XXXXXXXXXX

# POST
curl -u username --data &quot;param1=value1&amp;param2=value&quot; https://api.github.com

# 也可以指定一个文件，将该文件中的内容当作数据传递给服务器端
curl --data @filename https://github.api.com/authorizations
</code></pre><p>注：默认情况下，通过POST方式传递过去的数据中若有特殊字符，首先需要将特殊字符转义在传递给服务器端，如value值中包含有空格，则需要先将空格转换成%20，如：</p>
<pre><code>curl -d &quot;value%201&quot; http://hostname.com
</code></pre><p>在新版本的CURL中，提供了新的选项 –data-urlencode，通过该选项提供的参数会自动转义特殊字符。</p>
<pre><code>curl --data-urlencode &quot;value 1&quot; http://hostname.com
</code></pre><p>除了使用GET和POST协议外，还可以通过 -X 选项指定其它协议，如：</p>
<pre><code>curl -I -X DELETE https://api.github.cim
</code></pre><p>上传文件</p>
<pre><code>curl --form &quot;fileupload=@filename.txt&quot; http://hostname/resource
</code></pre>
        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/curl/">curl</a><a href="/tags/linux/">linux</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/07/27/curl-linux/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/07/27/curl-linux/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/07/26/shadowsocks-server/" title="通过shadowsocks科学上网" itemprop="url">通过shadowsocks科学上网</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-07-26T02:50:01.000Z" itemprop="datePublished"> 發表於 2016-07-26</time>
    
  </p>
</header>
    <div class="article-content">
        
        <blockquote>
<p>搬瓦工搭建流程</p>
</blockquote>
<p>搬瓦工搭建shadowsocks比较简单，博主之前并没有任何经验，也轻松搞定，使用其他方案获得账号的可忽略此章。</p>
<p>Linode的VPS网上也有一键安装脚本之类的，但都没有搬瓦工便捷，官方自带一键安装，还支持支付宝，简直是对墙内用户的贴心关照。</p>
<p>去<a href="https://bandwagonhost.com/aff.php?aff=9506" target="_blank" rel="external">搬瓦工官网</a>购买一个最便宜的VPS，之所买便宜的，是因为如果你的VPS只是用来翻墙的话，没必要买高性能的。</p>
<p>点击Shadowsocks Server，在右边再点击Install Shadowsocks Server，稍等一会就安装完成了，太简单，我就不贴图了。</p>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/shdowsocks/">shdowsocks</a><a href="/tags/科学上网/">科学上网</a><a href="/tags/翻墙/">翻墙</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/07/26/shadowsocks-server/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/07/26/shadowsocks-server/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/07/26/shadowsocks-client/" title="shadowsocks客户端配置" itemprop="url">shadowsocks客户端配置</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-07-26T02:17:24.000Z" itemprop="datePublished"> 發表於 2016-07-26</time>
    
  </p>
</header>
    <div class="article-content">
        
        <blockquote>
<p>ubuntu 安装 shadowsocks</p>
</blockquote>
<h5 id="一、pip-安装"><a href="#一、pip-安装" class="headerlink" title="一、pip 安装"></a>一、pip 安装</h5><ul>
<li>安装python库</li>
</ul>
<figure class="highlight vim"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">apt-<span class="built_in">get</span> <span class="keyword">update</span></div><div class="line">apt-<span class="built_in">get</span> install <span class="keyword">python</span>-pip</div><div class="line"><span class="keyword">python</span>-setuptools m2crypto</div><div class="line">pip install shadowsocks</div></pre></td></tr></table></figure>
<ul>
<li>启动shadowsocks</li>
</ul>
<p>A. 命令行启动</p>
<figure class="highlight lsl"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">sslocal -s <span class="number">11.22</span><span class="number">.33</span><span class="number">.44</span> -p <span class="number">50003</span> -k <span class="string">"123456"</span> -l <span class="number">1080</span> -t <span class="number">600</span> -m aes<span class="number">-256</span>-cfb</div></pre></td></tr></table></figure>
<p>B. 配置文件启动</p>
<figure class="highlight arduino"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">sslocal -c /<span class="built_in">home</span>/mudao/shadowsocks.json</div></pre></td></tr></table></figure>
<figure class="highlight json"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line">&#123;</div><div class="line"><span class="attr">"server"</span>:<span class="string">"11.22.33.44"</span>,</div><div class="line"><span class="attr">"server_port"</span>:<span class="number">50003</span>,</div><div class="line"><span class="attr">"local_port"</span>:<span class="number">1080</span>,</div><div class="line"><span class="attr">"password"</span>:<span class="string">"123456"</span>,</div><div class="line"><span class="attr">"timeout"</span>:<span class="number">600</span>,</div><div class="line"><span class="attr">"method"</span>:<span class="string">"aes-256-cfb"</span></div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>server  你服务端的IP<br>servier_port  你服务端的端口<br>local_port  本地端口，一般默认1080<br>passwd  ss服务端设置的密码<br>timeout  超时设置 和服务端一样<br>method  加密方法 和服务端一样</p>
<h5 id="二、shadowsocks-qt5-安装"><a href="#二、shadowsocks-qt5-安装" class="headerlink" title="二、shadowsocks-qt5 安装"></a>二、shadowsocks-qt5 安装</h5><p>在ubuntu上可以这样，通过PPA源安装，仅支持Ubuntu 14.04或更高版本。</p>
<figure class="highlight smali"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">sudo<span class="built_in"> add-apt-repository </span>ppa:hzwhuang/ss-qt5</div><div class="line">sudo apt-get update</div><div class="line">sudo apt-get install shadowsocks-qt5</div></pre></td></tr></table></figure>
<p>由于是图形界面，配置和windows基本没啥差别就不赘述了。经过上面的配置，你只是启动了sslocal 但是要上网你还需要配置下浏览器到指定到代理端口比如1080才可以正式上网。</p>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/ubuntu/">ubuntu</a><a href="/tags/linux/">linux</a><a href="/tags/shadowsocks/">shadowsocks</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/07/26/shadowsocks-client/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/07/26/shadowsocks-client/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/07/18/scp-linux/" title="linux命令——scp 两台linux机器间文件或目录传输" itemprop="url">linux命令——scp 两台linux机器间文件或目录传输</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-07-18T02:40:10.000Z" itemprop="datePublished"> 發表於 2016-07-18</time>
    
  </p>
</header>
    <div class="article-content">
        
        <ol>
<li>从远程复制文件到本地目录。</li>
</ol>
<blockquote>
<p>说明：从192.168.120.204机器上的/opt/soft/的目录中下载nginx-0.5.38.tar.gz 文件到本地/opt/soft/目录中</p>
</blockquote>
<figure class="highlight elixir"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$scp</span> root<span class="variable">@192</span>.<span class="number">168.120</span>.<span class="number">204</span><span class="symbol">:/opt/soft/nginx-</span><span class="number">0</span>.<span class="number">5.38</span>.tar.gz /opt/soft/</div></pre></td></tr></table></figure>
<ol>
<li>从远程复制目录到本地目录。</li>
</ol>
<blockquote>
<p>说明：从192.168.120.204机器上的/opt/soft/中下载mongodb 目录到本地的/opt/soft/目录来。</p>
</blockquote>
<figure class="highlight elixir"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$scp</span> -r root<span class="variable">@192</span>.<span class="number">168.120</span>.<span class="number">204</span><span class="symbol">:/opt/soft/mongodb</span> /opt/soft/</div></pre></td></tr></table></figure>
<ol>
<li>上传本地文件到远程目录。</li>
</ol>
<blockquote>
<p>说明：复制本地opt/soft/目录下的文件nginx-0.5.38.tar.gz 到远程机器192.168.120.204的opt/soft/scptest目录</p>
</blockquote>
<figure class="highlight elixir"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$scp</span> /opt/soft/nginx-<span class="number">0</span>.<span class="number">5.38</span>.tar.gz root<span class="variable">@192</span>.<span class="number">168.120</span>.<span class="number">204</span><span class="symbol">:/opt/soft/scptest</span></div></pre></td></tr></table></figure>
<ol>
<li>上传本地目录到远程目录。</li>
</ol>
<blockquote>
<p>说明：上传本地目录 /opt/soft/mongodb到远程机器192.168.120.204上/opt/soft/scptest的目录中去</p>
</blockquote>
<figure class="highlight elixir"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$scp</span> -r /opt/soft/mongodb root<span class="variable">@192</span>.<span class="number">168.120</span>.<span class="number">204</span><span class="symbol">:/opt/soft/scptest</span></div></pre></td></tr></table></figure>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/linux/">linux</a><a href="/tags/scp/">scp</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/07/18/scp-linux/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/07/18/scp-linux/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/07/11/linux-hosts/" title="linux环境下修改hosts" itemprop="url">linux环境下修改hosts</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-07-11T02:54:41.000Z" itemprop="datePublished"> 發表於 2016-07-11</time>
    
  </p>
</header>
    <div class="article-content">
        
        <blockquote>
<p>在linux下替换hosts,上google</p>
</blockquote>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">wget https:<span class="regexp">//</span>raw.githubusercontent.com<span class="regexp">/racaljk/</span>hosts<span class="regexp">/master/</span>hosts -qO <span class="regexp">/tmp/</span>hosts &amp;&amp; sudo sh -c <span class="string">'cat /tmp/hosts &gt; /etc/hosts'</span></div></pre></td></tr></table></figure>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/linux/">linux</a><a href="/tags/hosts/">hosts</a><a href="/tags/google/">google</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/07/11/linux-hosts/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/07/11/linux-hosts/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/07/08/java-security/" title="java 加解密" itemprop="url">java 加解密</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-07-08T07:26:30.000Z" itemprop="datePublished"> 發表於 2016-07-08</time>
    
  </p>
</header>
    <div class="article-content">
        
        <blockquote>
<p>在加解密类中引入</p>
</blockquote>
<figure class="highlight haxe"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">static</span> &#123;</div><div class="line">	Security.addProvider(<span class="keyword">new</span> <span class="type">BouncyCastleProvider</span>());</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">dependency</span>&gt;</span></div><div class="line">	<span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.bouncycastle<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></div><div class="line">	<span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>bcprov-jdk15<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></div><div class="line">	<span class="tag">&lt;<span class="name">version</span>&gt;</span>1.45<span class="tag">&lt;/<span class="name">version</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">dependency</span>&gt;</span></div></pre></td></tr></table></figure>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/java/">java</a><a href="/tags/security/">security</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/07/08/java-security/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/07/08/java-security/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/06/28/mysql-oracle/" title="mysql与oracle相关函数转化" itemprop="url">mysql与oracle相关函数转化</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-06-28T02:54:54.000Z" itemprop="datePublished"> 發表於 2016-06-28</time>
    
  </p>
</header>
    <div class="article-content">
        
        <h3 id="一、日期函数"><a href="#一、日期函数" class="headerlink" title="一、日期函数"></a>一、日期函数</h3><ul>
<li>mysql</li>
</ul>
<figure class="highlight llvm"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">str_to_date() </div><div class="line"><span class="keyword">select</span> str_to_date('<span class="number">2008</span><span class="number">-4</span><span class="number">-2</span> <span class="number">15</span>:<span class="number">3</span>:<span class="number">28</span>','<span class="symbol">%Y-</span><span class="symbol">%m-</span><span class="symbol">%d</span> <span class="symbol">%H</span>:<span class="symbol">%i</span>:<span class="symbol">%s</span>')<span class="comment">;</span></div></pre></td></tr></table></figure>
<ul>
<li>oracle</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">to_date()</div><div class="line"><span class="keyword">select</span> <span class="keyword">to_date</span>(<span class="string">'2005-01-01 13:14:20'</span>,<span class="string">'yyyy-MM-dd HH24:mm:ss'</span>) <span class="keyword">from</span> dual;</div></pre></td></tr></table></figure>
<h3 id="二、聚合函数"><a href="#二、聚合函数" class="headerlink" title="二、聚合函数"></a>二、聚合函数</h3><ul>
<li>mysql</li>
</ul>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">group_concat()</div><div class="line">select id,group_concat(name) <span class="keyword">from</span> aa<span class="built_in"> group </span>by id;</div></pre></td></tr></table></figure>
<ul>
<li>oracle</li>
</ul>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="title">wm_concat</span><span class="params">()</span></span></div><div class="line">select aa,wmsys.wm_concat(t1.name) from (</div><div class="line">select t<span class="selector-class">.name</span>,to_char(t<span class="selector-class">.createdate</span>,<span class="string">'yyyy-mm-dd'</span>) aa from td_user t where t<span class="selector-class">.td_conference_id</span> = <span class="number">3218</span> and t<span class="selector-class">.status</span> = <span class="number">1</span> and t<span class="selector-class">.createdate</span> &gt; to_date(<span class="string">'2012-10-28'</span>,<span class="string">'yyyy-mm-dd'</span>) <span class="attribute">order</span> by createdate desc</div><div class="line">) t1 group by t1.aa</div></pre></td></tr></table></figure>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/mysql/">mysql</a><a href="/tags/oracle/">oracle</a><a href="/tags/database/">database</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/06/28/mysql-oracle/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/06/28/mysql-oracle/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/06/27/tomcat-realm/" title="tomcat设置realm" itemprop="url">tomcat设置realm</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-06-27T06:31:31.000Z" itemprop="datePublished"> 發表於 2016-06-27</time>
    
  </p>
</header>
    <div class="article-content">
        
        <h3 id="一、server-xml"><a href="#一、server-xml" class="headerlink" title="一、server.xml"></a>一、server.xml</h3><ul>
<li>设置全局resource</li>
</ul>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">GlobalNamingResources</span>&gt;</span></div><div class="line"></div><div class="line">	<span class="tag">&lt;<span class="name">Resource</span> <span class="attr">name</span>=<span class="string">"hd_jndi"</span> <span class="attr">auth</span>=<span class="string">"Container"</span> <span class="attr">type</span>=<span class="string">"javax.sql.DataSource"</span></span></div><div class="line"><span class="tag">		<span class="attr">maxTotal</span>=<span class="string">"100"</span> <span class="attr">maxIdle</span>=<span class="string">"30"</span> <span class="attr">maxWaitMillis</span>=<span class="string">"10000"</span></span></div><div class="line"><span class="tag">		<span class="attr">username</span>=<span class="string">"root"</span> <span class="attr">password</span>=<span class="string">"login"</span> <span class="attr">driverClassName</span>=<span class="string">"com.mysql.jdbc.Driver"</span></span></div><div class="line"><span class="tag">		<span class="attr">url</span>=<span class="string">"jdbc:mysql://192.168.0.114:3306/fss?useUnicode=true&amp;amp;characterEncoding=UTF-8"</span>/&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">GlobalNamingResources</span>&gt;</span></div></pre></td></tr></table></figure>
<ul>
<li>在Engine下面加入realm结点</li>
</ul>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">&lt;Realm <span class="attribute">className</span>=<span class="string">"org.apache.catalina.realm.DataSourceRealm"</span></div><div class="line">	<span class="attribute">dataSourceName</span>=<span class="string">"hd_jndi"</span></div><div class="line">	<span class="attribute">userTable</span>=<span class="string">"v_account_password"</span> <span class="attribute">userNameCol</span>=<span class="string">"account"</span> <span class="attribute">userCredCol</span>=<span class="string">"password"</span>  </div><div class="line">	<span class="attribute">userRoleTable</span>=<span class="string">"v_user_role"</span> <span class="attribute">roleNameCol</span>=<span class="string">"role_name"</span>/&gt;</div></pre></td></tr></table></figure>
<h3 id="二、context-xml"><a href="#二、context-xml" class="headerlink" title="二、context.xml"></a>二、context.xml</h3><ul>
<li>在context中引用全局resource</li>
</ul>
<figure class="highlight fsharp"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">&lt;ResourceLink <span class="keyword">global</span>=<span class="string">"hd_jndi"</span> name=<span class="string">"hd_jndi"</span> <span class="class"><span class="keyword">type</span></span>=<span class="string">"javax.sql.DataSource"</span> /&gt;</div></pre></td></tr></table></figure>
<h3 id="三、servlet-api-与-jsp-api-与tomcat冲突"><a href="#三、servlet-api-与-jsp-api-与tomcat冲突" class="headerlink" title="三、servlet-api 与 jsp-api 与tomcat冲突"></a>三、servlet-api 与 jsp-api 与tomcat冲突</h3><ul>
<li>在context节点下加入 </li>
</ul>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">Loader</span> <span class="attr">delegate</span>=<span class="string">"true"</span>&gt;</span><span class="tag">&lt;/<span class="name">Loader</span>&gt;</span></div></pre></td></tr></table></figure>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/mysql/">mysql</a><a href="/tags/tomcat/">tomcat</a><a href="/tags/realm/">realm</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/06/27/tomcat-realm/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/06/27/tomcat-realm/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/06/27/hibernate/" title="hibernate连接mysql查询中文无效的问题" itemprop="url">hibernate连接mysql查询中文无效的问题</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="linyu" target="_blank" itemprop="author">linyu</a>
		
  <p class="article-time">
    <time datetime="2016-06-27T06:29:07.000Z" itemprop="datePublished"> 發表於 2016-06-27</time>
    
  </p>
</header>
    <div class="article-content">
        
        <blockquote>
<p>设置mysql的连接需要加上编码</p>
</blockquote>
<figure class="highlight groovy"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="string">jdbc:</span><span class="string">mysql:</span><span class="comment">//192.168.0.114:3306/fss?useUnicode=true&amp;amp;characterEncoding=UTF-8</span></div></pre></td></tr></table></figure>

        
        
        <p class="article-more-link">
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/hibernate/">hibernate</a><a href="/tags/mysql/">mysql</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="/2016/06/27/hibernate/#comments" class="ds-thread-count comments-count-link" data-thread-key="2016/06/27/hibernate/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>







  <nav id="page-nav" class="clearfix">
    <a class="extend prev" rel="prev" href="/page/2/"><span></span>Prev</a><a class="page-number" href="/">1</a><a class="page-number" href="/page/2/">2</a><span class="page-number current">3</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><a class="page-number" href="/page/6/">6</a><a class="extend next" rel="next" href="/page/4/">Next<span></span></a>
  </nav>

</div>
      <div class="openaside"><a class="navbutton" href="#" title="顯示側邊欄"></a></div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隱藏側邊欄"></a></div>
<aside class="clearfix">

  
<div class="github-card">
<p class="asidetitle">Github 名片</p>
<div class="github-card" data-github="bigsuperangel" data-width="220" data-height="119" data-theme="medium">
<script type="text/javascript" src="//cdn.jsdelivr.net/github-cards/latest/widget.js" ></script>
</div>
  </div>



  

  
<div class="tagslist">
	<p class="asidetitle">標簽</p>
		<ul class="clearfix">
		
			
				<li><a href="/tags/linux/" title="linux">linux<sup>16</sup></a></li>
			
		
			
				<li><a href="/tags/ubuntu/" title="ubuntu">ubuntu<sup>11</sup></a></li>
			
		
			
				<li><a href="/tags/java/" title="java">java<sup>10</sup></a></li>
			
		
			
				<li><a href="/tags/maven/" title="maven">maven<sup>7</sup></a></li>
			
		
			
				<li><a href="/tags/mysql/" title="mysql">mysql<sup>4</sup></a></li>
			
		
			
				<li><a href="/tags/python/" title="python">python<sup>3</sup></a></li>
			
		
			
				<li><a href="/tags/tomcat/" title="tomcat">tomcat<sup>3</sup></a></li>
			
		
			
				<li><a href="/tags/alsamixer/" title="alsamixer">alsamixer<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/git/" title="git">git<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/hexo/" title="hexo">hexo<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/command/" title="command">command<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/eclipse/" title="eclipse">eclipse<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/doc命令/" title="doc命令">doc命令<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/database/" title="database">database<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/nodejs/" title="nodejs">nodejs<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/freenom/" title="freenom">freenom<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/gradle/" title="gradle">gradle<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/ignore/" title="ignore">ignore<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/security/" title="security">security<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/jitpack/" title="jitpack">jitpack<sup>1</sup></a></li>
			
		
		</ul>
</div>


  <div class="linkslist">
  <p class="asidetitle">友情鏈接</p>
    <ul>
        
          <li>
            
            	<a href="https://www.oschina.net" target="_blank" title="开源中国">开源中国</a>
            
          </li>
        
          <li>
            
            	<a href="http://stackoverflow.com" target="_blank" title="stackoverflow">stackoverflow</a>
            
          </li>
        
    </ul>
</div>

  


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS 訂閱</a>
</div>

  <div class="weiboshow">
  <p class="asidetitle">新浪微博</p>
    <iframe width="100%" height="119" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=119&fansRow=2&ptype=1&speed=0&skin=9&isTitle=1&noborder=1&isWeibo=0&isFans=0&uid=null&verifier=&dpc=1"></iframe>
</div>


</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> 知行合一 <br/>
			This is my blog,believe it or not.</p>
	</section>
	 
	<div class="social-font" class="clearfix">
		
		
		<a href="https://github.com/bigsuperangel" target="_blank" class="icon-github" title="github"></a>
		
		
		
		
		
		
		
		
		
		<a href="mailto:bigsuperangel@gmail.com" target="_blank" class="icon-email" title="Email Me"></a>
		
	</div>
			
		

		<p class="copyright">
		Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Jacman">Jacman</a> © 2019 
		
		<a href="/about" target="_blank" title="linyu">linyu</a>
		
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
  
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else{
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
        
    }
  });
});
</script>










<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.article-content').each(function(i){
    $(this).find('img').each(function(){
      if ($(this).parent().hasClass('fancybox')) return;
      var alt = this.alt;
      if (alt) $(this).after('<span class="caption">' + alt + '</span>');
      $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
    });
    $(this).find('.fancybox').each(function(){
      $(this).attr('rel', 'article' + i);
    });
  });
  if($.fancybox){
    $('.fancybox').fancybox();
  }
}); 
</script>



<!-- Analytics Begin -->

<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-84488915-1', 'bigsuperangel.github.io');  
ga('send', 'pageview');
</script>





<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="返回頂部"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

<!-- Tiny_search Begin -->

<!-- Tiny_search End -->

  </body>
 </html>
